<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    var x = 10,
      y = 20;
    console.log(x + y);
    console.log(x - y);
    console.log(x * y);
    console.log(x / y); //.5 得小数
    console.log(x / 0); //返回Infinity 不会报错
    console.log(x % y);
    console.log(13 % 10); //3
    console.log(13.7 % 10); //3.6777
    console.log(-13 % 10); //-3
    console.log(-13 % -10); //-3
    console.log(13 % -10); //3

    var z = ++x; //x=x+1 z=x
    console.log(x, z);
    var z = x++; //z=x x=x+1
    console.log(x, z);
    z = ++x + ++x + x++ + x; //13+14+14+15=56
    console.log(x, z);
  </script>
</html>
